#ifndef CLIENT_H
#define CLIENT_H

#include <vector>
#include <string>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

// 定义点结构体
struct Point {
    double x;
    double y;
    Point(double x_, double y_) : x(x_), y(y_) {}
};

extern std::vector<std::string> sort_points_urls;


// 声明函数
double calculate_distance(const Point& p1, const Point& p2);
json send_request(const std::string& url, const json& data);
std::string get_next_url(const std::vector<std::string>& urls, int& index);
std::vector<Point> get_sorted_result(const std::vector<Point>& task_points, const Point& start_point,int& url_index);
#endif // CLIENT_H
